/*
First time? Check out the tutorial game:
https://sprig.hackclub.com/gallery/getting_started

@title: Mini rocket league
@author: Rhys
@description: None
@tags: []
@addedOn: 2024-00-00
*/

const player = "a";
const player0 = "b";


const goalExpOrange = "c";
const goalExpBlue = "d";
const orangeWall = "e";
const blueWall = "f";
const orangeWallTop = "w";
const blueWallTop = "x";
const orangeWallBot = "z";
const blueWallBot = "y";
const wall = "o";

const ball = "g";
const orangeGoalTop = "h";
const orangeGoalMid = "i";
const orangeGoalBot = "j";
const blueGoalTop = "k";
const blueGoalMid = "l";
const blueGoalBot = "m";
const grass = "n";



setLegend(
  [orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
  [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
  [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
  [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
  [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
  [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],

  [player, bitmap`
................
................
................
55555L..........
.77735....555L..
.5553555..555L..
.511CCC55505556.
.5LL11L55005551.
.5LL11L55005551.
.511CCC55505556.
.5553555..555L..
.77735....555L..
55555L..........
................
................
................`],
  [player0, bitmap`
................
................
................
..........L99999
..L999....9C333.
..L999..999C999.
.69990999CCC119.
.19990099L11LL9.
.19990099L11LL9.
.69990999CCC119.
..L999..999C999.
..L999....9C333.
..........L99999
................
................
................`],
  [wall, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],

  [ball, bitmap`
....LLLLLLLL....
...L111L1111L...
..L1111L1111LL..
.L1L11LLLL1L11L.
L111LLLLLLL1111L
L111LL1111LL111L
L11LL111111LL11L
L11LL115511LLLLL
L11LL115511LL11L
LLLLL111111LL11L
L111LL1111LL111L
L1111LLLLLL1L11L
.L11L1LLLL111LL.
..LL1111L1111L..
...L1111L111L...
....LLLLLLLL....`],
  [orangeGoalTop, bitmap`
..19LLLLLLLLLLLL
..19999999999LLL
............99LL
.............9LL
.............9LL
.............99L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L`],
  [orangeGoalMid, bitmap`
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L`],
  [orangeGoalBot, bitmap`
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
.............99L
.............9LL
.............9LL
............99LL
..19999999999LLL
..19LLLLLLLLLLLL`],
  [blueGoalTop, bitmap`
LLLLLLLLLLLL51..
LLL55555555551..
LL55............
LL5.............
LL5.............
L55.............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............`],
  [blueGoalMid, bitmap`
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............`],
  [blueGoalBot, bitmap`
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L55.............
LL5.............
LL5.............
LL55............
LLL55555555551..
LLLLLLLLLLLL51..`],
  [grass, bitmap`
44444444444444DD
4444D24444444DD4
44444D44DD424444
4DD444D4D44DD444
44D444DDD444D444
4444444444444444
444444444444DDD4
444444444444D444
44244D4444444444
44D4DD4444DD4444
44D4D4442D4DD4D4
44DDD444D4444D44
DD44444DD444DD44
4DD4444D44444444
44D4444444444444
4444444444444444`],
  [goalExpBlue, bitmap`
..7.L777LLLL7777
7777771771777557
.777111L77755257
.55571LLL7522777
752257777552777L
L75225575557711L
L117552255777777
L1177752557LLLL7
L17557722255L11L
222257775225711L
755777117555571L
5777777L7755557L
77777777LL752277
77LL1177L1155257
77.L1177L1175555
.7..LLL77LLL7757`],
  [goalExpOrange, bitmap`
999999LLLLLL.99.
.999999L111199..
..99CC991119999.
.L122CC99L199C99
L11129CC9999CC1L
L111LLC2299CC11L
L11LL11CC2CCL11L
L11LL11CC22CLLLL
L11LL99CCCCC911L
LLLLCCCCC922991L
L9CCC22CCCC22C1L
99999CL9999CC22L
99999999LL999CCC
.9999991L1999999
.9999111L119999.
99..LLLLLLLL..99`],
);

setBackground(grass);

const goal = tune`
48.85993485342019,
48.85993485342019: B4^48.85993485342019 + D5^48.85993485342019 + E5/48.85993485342019 + C5/48.85993485342019 + A4/48.85993485342019,
48.85993485342019: A5~48.85993485342019 + F5~48.85993485342019 + D5~48.85993485342019 + G5-48.85993485342019 + E5-48.85993485342019,
48.85993485342019: E5/48.85993485342019 + C5/48.85993485342019 + A4/48.85993485342019 + D5^48.85993485342019 + B4^48.85993485342019,
48.85993485342019: E5-48.85993485342019 + D5^48.85993485342019 + A5-48.85993485342019 + G5^48.85993485342019 + F5^48.85993485342019,
1319.2182410423452`;
const drive = tune`
86.95652173913044,
86.95652173913044: G4-86.95652173913044 + F4^86.95652173913044 + A4~86.95652173913044 + D4~86.95652173913044 + E4-86.95652173913044,
86.95652173913044: A4~86.95652173913044 + D4~86.95652173913044 + G4-86.95652173913044 + E4-86.95652173913044 + F4^86.95652173913044,
2521.7391304347825`;
const jump = tune`
86.95652173913044,
86.95652173913044: A4~86.95652173913044 + E5^86.95652173913044 + A5^86.95652173913044 + G5-86.95652173913044,
86.95652173913044: A4~86.95652173913044 + E5^86.95652173913044 + A5^86.95652173913044 + B5-86.95652173913044,
2521.7391304347825`;

setSolids([player, orangeWall, blueWall]);
const levels = [
  map`
..............................
.................yyyyyyyyyyyyy
.hofzef.chf.hf.d.eoooooooooooo
.ifhokf.yiom.f.y.eoooooooooooo
.ifiolfifioomfif.eoooooooooooo
.ifiolfififhofif.eoooooooooooo
.jfiolfjfjf.jfjf.eoooooooooooo
.................eoooooooooooo
.hoxxmhf.........eoooooooooooo
.if..fif..k.a..h.eoooooooooooo
.ioyykif..lag.bd.eoooooooooooo
.ifhm.if..m.b..j.eoooooooooooo
.jf.hmjof........eoooooooooooo
.................wwwwwwwwwwwww
..............................`,
  map`
exxxxxxxxxxxxwwwwwwwwwwwwf
f........................e
f........................e
f........................e
f........................e
k........................h
la..........g............i
m........................j
f........................e
f........................e
f........................e
f........................e
eyyyyyyyyyyyyzzzzzzzzzzzzf`,
  map`
exxxxxxxxexxxwwwwwwwewwwwf
f........e..........e....e
f........e..........e....e
xxxf.....e..........e....e
...f.....e..........e....e
..gf.....e...............h
.a.f.....e...............i
...f.....e.....e.........j
yyyf.....e.....e.........e
f..............e.........e
f..............e.........e
f..............e.........e
eyyyyyyyyyyyyzzezzzzzzzzzf`,
  map`
exxxxxxxgxxxxffffwwwwwwwwf
f......xxxxxxffff........e
f............ffff........e
f............ffff........e
f............ffff........e
f............ffff........h
f............ffff........i
f............ffff........j
f............ffff........e
f..eef.......ffff........e
f..eaf.......ffff........e
f..eff.......ffff........e
eyyyyyyyyyyyyffffzzzzzzzzf`,
  map`
exxxfxxxxxxxxwwwwwwwwwwwwf
f...f....................e
f.g.f....................e
xxxxx......ewwwf.........e
...........e.h.f.........e
...........e.j.f.........e
...........ezzzf.........e
.........................e
y........................e
xxxxe....................e
....e....................e
..a.e....................e
....e...yyyyyzzzzzzzzzzzzf`,
  map`
exxxxxxxxxxxxwwwwwwwwwwwwf
f........................e
f........................e
xxxf.....................e
...f.....................e
..gf......................
.a.f......................
...f......................
yyyf.....................e
f........................e
f........................e
f........................e
eyyyyyyyyyyyyzzzzzzzzzzzzf`,
  
]

let currLevel = 0;
setMap(levels[currLevel]);


let canMove = true;
let currDirection = "right";
let currStatus = "ground";
let ballStatus = "down";
let canRun = true;
var blueScore = 0;
var orangeScore = 0;
var selectedText = 0;

textDrawer();
//first menu text
onInput("i", () => {
  if (currLevel === 0 && selectedText === 1) {
    setSprites();
    orangeScore = 0;
    blueScore = 0;
    currLevel = 1;
    setMap(levels[1]);
  } else if (currLevel === 0 && selectedText === 0) {
    setSprites();
    currLevel = 2;
    setMap(levels[2]);
  } else if (currLevel >= 1) {
    setSprites();
    currLevel = 0;
    setMap(levels[0]);
  }
});

onInput("w", () => {
  if (currLevel === 0) {
    selectedText = 0;
    textDrawer();
  }

});
onInput("s", () => {
  if (currLevel === 0) {
    selectedText = 1;
    textDrawer();
  }

});
//

//movement
onInput("w", () => {
  if (canMove && tilesWith(player, orangeWallTop).length != 1 && tilesWith(player, blueWallTop).length != 1 ) {
    currDirection = "up";
    getFirst(player).y -= 1;
    if (tilesWith(player, blueWall).length != 1 && tilesWith(player, orangeWall).length != 1 && currStatus != "air") {
      currStatus = "ground";
      setSolids([player, orangeWall, blueWall]);
    }
    setCarAnimation()
    playTune(drive, 1);

  }

});
onInput("a", () => {
  if (canMove) {
    currDirection = "left";
    getFirst(player).x -= 1;
    if (tilesWith(player, blueWall).length != 1 && tilesWith(player, orangeWall).length != 1 && currStatus != "air") {
      currStatus = "ground";
      setSolids([player, orangeWall, blueWall]);
    }
    setCarAnimation();
    playTune(drive, 1);

  }
});
onInput("s", () => {
  if (canMove && tilesWith(player, orangeWallBot).length != 1 && tilesWith(player, blueWallBot).length != 1 ) {
    currDirection = "down";
    getFirst(player).y += 1;
    if (tilesWith(player, blueWall).length != 1 && tilesWith(player, orangeWall).length != 1 && currStatus != "air") {
      currStatus = "ground";
      setSolids([player, orangeWall, blueWall]);
    }
    setCarAnimation();
    playTune(drive, 1);

  }
});
onInput("d", () => {

  if (canMove) {
    currDirection = "right";
    getFirst(player).x += 1;
    if (tilesWith(player, blueWall).length != 1 && tilesWith(player, orangeWall).length != 1 && currStatus != "air" ) {
      currStatus = "ground";
      setSolids([player, orangeWall, blueWall]);
    }
    setCarAnimation();
    playTune(drive, 1);

  }
});
//jump
onInput("k", () => {
  if (canMove) {
    currStatus = "air";
    setSolids([orangeWall, blueWall]);
    setCarAnimation();
    playTune(jump, 1);
    setTimeout(() => {
      if (tilesWith(player, blueWall).length === 1) {
        currStatus = "blueWall";
      } else if (tilesWith(player, orangeWall).length === 1) {
        currStatus = "orangeWall";
      } else {
        currStatus = "ground";
        setSolids([player, orangeWall, blueWall]);
      }
      setCarAnimation();
    }, 700);
  }
});


afterInput(() => {

  textDrawer();

  setTimeout(() => {
    canMove = true;
  }, 300);
  //checking if goals
  goals();
  // Check for collision between player and ball
  ballPlayerCollisions();
  //check if ball is hitting walls
  ballplayerWallCollisions()

}); //end afterinput________________________________________________________________________________________________

function goals() {
  if (canRun) {
    if (tilesWith(ball, orangeGoalTop).length == 1 || tilesWith(ball, orangeGoalBot).length == 1 || tilesWith(ball, orangeGoalMid).length == 1) {
      canMove = false;
      canRun = false;
      playTune(goal, 1);
      playTune(goal, 1);
      //goal explosion animation
      setLegend([ball, bitmap`
..7.L77LLLLL7777
77777711L1777557
.771111LL1115257
.51111LLL1111777
751157777551117L
L71225575557111L
L117552255777117
L1177752557LLLLL
L115L7722255111L
22LL17775225111L
75L11111L511111L
57111111L111117L
77711111L1111177
77LL1111L1111257
77.L117L11175555
.7..LLLL7LLL7757`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
    ..7.L777LLLL7777
    7777771771777557
    .777111L77755257
    .55571LLL7522777
    752257777552777L
    L75225575557711L
    L117552255777777
    L1177752557LLLL7
    L17557722255L11L
    222257775225711L
    755777117555571L
    5777777L7755557L
    77777777LL752277
    77LL1177L1155257
    77.L1177L1175555
    .7..LLL77LLL7757`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
5.777777..777777
5577777777777557
.522777777755257
.552277777255777
7555557752257777
777755575255777.
777755555555777.
7775222557777777
7775225555777777
7722555555777777
552277777577777.
5257777777257777
5257777777222577
5577777777752257
7777777777775555
.7..777777777757`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
5.777777..777777
5577777557777557
.522725557755257
.525555257255777
7555555552255577
77555255L555257.
77525L..L555257.
75555...2L555227
55555LL.L2555557
525555LL25555557
555225552552275.
5255255555557777
5255555225522577
5577755555752257
7777755575775555
.7..777777777757`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
5.755577..775777
5555557557555557
.555725557755255
.555555257255575
7555..5552255577
5555.......5257.
575.........257.
55......2...5227
55..........5557
525.........5557
55522......2275.
5255255555557777
5255555225522555
5577755555752557
7555755575775555
.7.5557557777557`], );
              setTimeout(() => {
                setLegend([ball, bitmap`
..7...77..77.777
......7..7.....7
....72...77..2..
.......2.72...7.
7........22...77
............2.7.
.7..........2.7.
........2....227
...............7
.2.............7
...22......227..
.2..2.......7777
.2.....22..22...
..777.....7.2..7
7...7...7.77....
.7....7..7777..7`], );
              }, 100);
            }, 100);
          }, 300);
        }, 300);

      }, 300);
      //

      addText("Blue Scored!", { x: 4, y: 7, color: color`6` });

      //knockback from goal
      getFirst(player).x -= 1;
      setTimeout(() => {
        getFirst(player).x -= 1;
        setTimeout(() => {
          getFirst(player).x -= 2;
          setTimeout(() => {
            getFirst(player).x -= 2;
            setTimeout(() => {
              getFirst(player).x -= 2;
            }, 100);
          }, 100);
        }, 100);
      }, 100);
      //

      setTimeout(() => {
        blueScore = blueScore + 1;
        if (currLevel === 1) {
          getFirst(ball).x = 12;
          getFirst(ball).y = 6;
          getFirst(player).x = 3;
          getFirst(player).y = 6;
        } else if (currLevel === 0) {
          getFirst(ball).x = 11;
          getFirst(ball).y = 11;
          getFirst(player).x = 9;
          getFirst(player).y = 11;
        }

        clearText();
        setLegend([ball, bitmap`
....LLLLLLLL....
...L111L1111L...
..L1111L1111LL..
.L1L11LLLL1L11L.
L111LLLLLLL1111L
L111LL1111LL111L
L11LL111111LL11L
L11LL115511LLLLL
L11LL115511LL11L
LLLLL111111LL11L
L111LL1111LL111L
L1111LLLLLL1L11L
.L11L1LLLL111LL.
..LL1111L1111L..
...L1111L111L...
....LLLLLLLL....`], );
        setLegend([player, bitmap`
................
................
................
55555L..........
.77735....555L..
.5553555..555L..
.511CCC55505556.
.5LL11L55005551.
.5LL11L55005551.
.511CCC55505556.
.5553555..555L..
.77735....555L..
55555L..........
................
................
................`], );
        canMove = true;
        canRun = true;
        //if on traning mode set to next level
        if (currLevel >= 2) {
          currLevel += 1;
          let currMap = levels[currLevel];
          setSprites();
          setMap(currMap);
        }
        //
      }, 1500);
    }

    if (tilesWith(ball, blueGoalTop).length == 1 || tilesWith(ball, blueGoalBot).length == 1 || tilesWith(ball, blueGoalMid).length == 1) {
      canMove = false;
      canRun = false;

      //goal explosion animation
      setLegend([ball, bitmap`
9999LLLLL99L.9..
9CC9991L11999999
9C2C111LL111199.
9991111LLL1111C.
L9111CC9999C11C9
L1119CCC9CC2219L
911999CC22CC911L
LLLLL9CC2C99911L
L111CC22299LC11L
L111C22C9991LL22
L11111CL11111LC9
L911111L1111119C
9911111L11111999
9C21111L1111LL99
CCCC9111L911L.99
9C99LLL9LLLL..9.`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
9999LLLL999L.9..
9CC9991991999999
9C2CC999L111999.
99922C9LLL19CCC.
L9992CC9999C22C9
L1199CCC9CC22C9L
999999CC22CC911L
9LLLL9CC2C99911L
L11LCC22299CC91L
L119C22C999C2222
L19CCCC911999CC9
L9CCCC99L999999C
9922C9LL99999999
9C2CC11L9911LL99
CCCC911L9911L.99
9C99LLL99LLL..9.`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
999999..999999.C
9CC99999999999CC
9C2CC999999922C.
999CC29999922CC.
9999C22C99CCCCC9
.999CC2C9CCC9999
.999CCCCCCCC9999
9999999CC222C999
999999CCCC22C999
999999CCCCCC2299
.99999C9999922CC
9999C29999999C2C
99C2229999999C2C
9C22C999999999CC
CCCC999999999999
9C9999999999..9.`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
999999..999999.C
9CC9999CC99999CC
9C2CC99CCC2922C.
999CC29C2CCCC2C.
99CCC22CCCCCCCC9
.9C2CCCLCC2CCC99
.9C2CCCL..LC2C99
922CCCL2...CCCC9
9CCCCC2L.LLCCCCC
9CCCCCC2LLCCCC2C
.C922CC2CCC22CCC
9999CCCCCCC2CC2C
99C22CC22CCCCC2C
9C22C9CCCCC999CC
CCCC99C9CCC99999
9C9999999999..9.`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
999C99..99CCC9.C
9CCCCC9CC9CCCCCC
CC2CC99CCC29CCC.
C9CCC29C2CCCCCC.
99CCC22CCC..CCC9
.9C2C.......CCCC
.9C2.........C9C
922C...2......CC
9CCC..........CC
9CCC.........C2C
.C922......22CCC
9999CCCCCCC2CC2C
CCC22CC22CCCCC2C
9CC2C9CCCCC999CC
CCCC99C9CCC9CCC9
9CC9999CC9CCC.9.`], );
              setTimeout(() => {
                setLegend([ball, bitmap`
999.99..99...9..
9.....9..9......
..2..99...29....
.9...29.2.......
99...22........9
.9.2............
.9.2..........9.
922....2........
9...............
9.............2.
..922......22...
9999.......2..2.
...22..22.....2.
9..2.9.....999..
....99.9...9...9
9..9999..9....9.`], );
              }, 100);
            }, 100);
          }, 300);
        }, 300);
      }, 300);
      //

      addText("Orange Scored!", { x: 4, y: 7, color: color`6` });

      //knockback from goal
      getFirst(player).x += 1;
      setTimeout(() => {
        getFirst(player).x += 1;
        setTimeout(() => {
          getFirst(player).x += 2;
          setTimeout(() => {
            getFirst(player).x += 2;
            setTimeout(() => {
              getFirst(player).x += 2;
            }, 100);
          }, 100);
        }, 100);
      }, 100);
      //

      setTimeout(() => {
        orangeScore = orangeScore + 1;
        if (currLevel === 1) {
          getFirst(ball).x = 12;
          getFirst(ball).y = 6;
          getFirst(player).x = 3;
          getFirst(player).y = 6;
        }
        setLegend([ball, bitmap`
....LLLLLLLL....
...L111L1111L...
..L1111L1111LL..
.L1L11LLLL1L11L.
L111LLLLLLL1111L
L111LL1111LL111L
L11LL111111LL11L
L11LL115511LLLLL
L11LL115511LL11L
LLLLL111111LL11L
L111LL1111LL111L
L1111LLLLLL1L11L
.L11L1LLLL111LL.
..LL1111L1111L..
...L1111L111L...
....LLLLLLLL....`], );
        setLegend([player, bitmap`
................
................
................
55555L..........
.77735....555L..
.5553555..555L..
.511CCC55505556.
.5LL11L55005551.
.5LL11L55005551.
.511CCC55505556.
.5553555..555L..
.77735....555L..
55555L..........
................
................
................`], );
        clearText();
        canMove = true;
        canRun = true;
        //if on traning mode set to next level
        if (currLevel >= 2) {
          currLevel += 1;
          setSprites();
          setMap(levels[currLevel]);
        }
      }, 1500);
    }
  }
} //end goals() function

function ballPlayerCollisions() {
  if (tilesWith(player, ball).length == 1) {
    if (currDirection === "up" && ballStatus === "down" && currStatus === "ground") {
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
................
................
................
................
................
................
.....LLL........
....L111L.......
...L11L11L......
...L1L5L1L......
...L11L11L......
...L11111L......
....L111L.......
.....LLL........
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
................
................
................
................
...LLL..........
..L111L.........
.L11L11L........
.L1L5L1L........
.L11L11L........
.L11111L........
..L111L.........
...LLL..........
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
................
....LLL.........
...L111L........
..L11L11L.......
..L1L5L1L.......
..L11L11L.......
..L11111L.......
...L111L........
....LLL.........
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......
................
................
................
................
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      getFirst(ball).y -= 1;
      setTimeout(() => {
        getFirst(ball).y -= 1;
        console.log("setting ball animation to normal");
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);

    } else if (currDirection === "left" && ballStatus === "down" && currStatus === "ground") {

      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
.........LLL....
........L111L...
.......L11L11L..
.......L1L5L1L..
.......L11L11L..
.......L11111L..
........L111L...
.........LLL....
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
......LLL.......
.....L111L......
....L11L11L.....
....L1L5L1L.....
....L11L11L.....
....L11111L.....
.....L111L......
......LLL.......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
...LLL..........
..L111L.........
.L11L11L........
.L1L5L1L........
.L11L11L........
.L11111L........
..L111L.........
...LLL..........
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x -= 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x -= 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";

      }, 1000);

    } else if (currDirection === "down" && ballStatus === "down" && currStatus === "ground") {
      //animate ball
      setLegend([ball, bitmap`
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......
................
................
................
................
................
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
................
.........LLLL...
........L1111L..
.......L111L11L.
.......L11L5L1L.
.......L111L11L.
........L1111L..
.........LLLL...
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
................
................
................
................
................
..........LLLL..
.........L1111L.
........L111L11L
........L11L5L1L
........L111L11L
.........L1111L.
..........LLLL..
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
.........LLLL...
........L1111L..
.......L111L11L.
.......L11L5L1L.
.......L111L11L.
........L1111L..
.........LLLL...
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
................
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      getFirst(ball).y += 1;
      setTimeout(() => {
        getFirst(ball).y += 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);

    } else if (currDirection === "right" && ballStatus === "down" && currStatus === "ground") {

      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
....LLL.........
...L111L........
..L11L11L.......
..L1L5L1L.......
..L11L11L.......
..L11111L.......
...L111L........
....LLL.........
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
..........LLL...
.........L111L..
........L11L11L.
........L1L5L1L.
........L11L11L.
........L11111L.
.........L111L..
..........LLL...
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //

      ballStatus = "up";
      getFirst(ball).x += 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x += 1;
        setLegend([ball, bitmap`
  ....LLLLLLLL....
  ...L111L1111L...
  ..L1111L1111LL..
  .L1L11LLLL1L11L.
  L111LLLLLLL1111L
  L111LL1111LL111L
  L11LL111111LL11L
  L11LL115511LLLLL
  L11LL115511LL11L
  LLLLL111111LL11L
  L111LL1111LL111L
  L1111LLLLLL1L11L
  .L11L1LLLL111LL.
  ..LL1111L1111L..
  ...L1111L111L...
  ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);

    } else if (currDirection === "up" && ballStatus === "up" && currStatus === "air") {
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
................
................
................
................
................
................
.....LLL........
....L111L.......
...L11L11L......
...L1L5L1L......
...L11L11L......
...L11111L......
....L111L.......
.....LLL........
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
................
................
................
................
...LLL..........
..L111L.........
.L11L11L........
.L1L5L1L........
.L11L11L........
.L11111L........
..L111L.........
...LLL..........
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
................
....LLL.........
...L111L........
..L11L11L.......
..L1L5L1L.......
..L11L11L.......
..L11111L.......
...L111L........
....LLL.........
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......
................
................
................
................
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      getFirst(ball).y -= 1;
      setTimeout(() => {
        getFirst(ball).y -= 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);
    } else if (currDirection === "down" && ballStatus === "up" && currStatus === "air") {
      //animate ball
      setLegend([ball, bitmap`
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......
................
................
................
................
................
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
................
.........LLLL...
........L1111L..
.......L111L11L.
.......L11L5L1L.
.......L111L11L.
........L1111L..
.........LLLL...
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
................
................
................
................
................
..........LLLL..
.........L1111L.
........L111L11L
........L11L5L1L
........L111L11L
.........L1111L.
..........LLLL..
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
.........LLLL...
........L1111L..
.......L111L11L.
.......L11L5L1L.
.......L111L11L.
........L1111L..
.........LLLL...
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
................
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      getFirst(ball).y += 1;
      setTimeout(() => {
        getFirst(ball).y += 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);


    } else if (currDirection === "left" && ballStatus === "up" && currStatus === "air") {

      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
.........LLL....
........L111L...
.......L11L11L..
.......L1L5L1L..
.......L11L11L..
.......L11111L..
........L111L...
.........LLL....
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
......LLL.......
.....L111L......
....L11L11L.....
....L1L5L1L.....
....L11L11L.....
....L11111L.....
.....L111L......
......LLL.......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
...LLL..........
..L111L.........
.L11L11L........
.L1L5L1L........
.L11L11L........
.L11111L........
..L111L.........
...LLL..........
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x -= 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x -= 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";

      }, 1000);
    } else if (currDirection === "right" && ballStatus === "up" && currStatus === "air") {
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
....LLL.........
...L111L........
..L11L11L.......
..L1L5L1L.......
..L11L11L.......
..L11111L.......
...L111L........
....LLL.........
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
..........LLL...
.........L111L..
........L11L11L.
........L1L5L1L.
........L11L11L.
........L11111L.
.........L111L..
..........LLL...
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //

      ballStatus = "up";
      getFirst(ball).x += 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x += 1;
        setLegend([ball, bitmap`
  ....LLLLLLLL....
  ...L111L1111L...
  ..L1111L1111LL..
  .L1L11LLLL1L11L.
  L111LLLLLLL1111L
  L111LL1111LL111L
  L11LL111111LL11L
  L11LL115511LLLLL
  L11LL115511LL11L
  LLLLL111111LL11L
  L111LL1111LL111L
  L1111LLLLLL1L11L
  .L11L1LLLL111LL.
  ..LL1111L1111L..
  ...L1111L111L...
  ....LLLLLLLL....`], );
        ballStatus = "down";
      }, 1000);

    }
  } //end tileswith ball
} //end playerBallCollisions() function

function ballplayerWallCollisions() {
  if (canRun) {
    if (tilesWith(ball, blueWallTop).length == 1 || tilesWith(ball, orangeWallTop).length == 1) {
      canRun = false;
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......
................
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
......LLLL......
.....L1111L.....
....L111111L....
...L1111L111L...
...L111L5L11L...
...L1111L111L...
....L111111L....
.....L1111LL....
......LLLL......
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
................
................
................
......LLLL......
.....L1111L.....
....L111111L....
...L1111L111L...
...L111L5L11L...
...L1111L111L...
....L111111L....
.....L1111L.....
......LLLL......
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
................
......LLLL......
.....L1111L.....
....L111L11L....
....L11L5L1L....
....L111L11L....
.....L1111L.....
......LLLL......`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      //getFirst(ball).y += 1;
      setTimeout(() => {
        getFirst(ball).y += 1;
        setLegend([ball, bitmap`
      ....LLLLLLLL....
      ...L111L1111L...
      ..L1111L1111LL..
      .L1L11LLLL1L11L.
      L111LLLLLLL1111L
      L111LL1111LL111L
      L11LL111111LL11L
      L11LL115511LLLLL
      L11LL115511LL11L
      LLLLL111111LL11L
      L111LL1111LL111L
      L1111LLLLLL1L11L
      .L11L1LLLL111LL.
      ..LL1111L1111L..
      ...L1111L111L...
      ....LLLLLLLL....`], );
        ballStatus = "down";
        canRun = true;
      }, 1000);
      //check if ball is on top walls  
    }
    if (tilesWith(ball, blueWallBot).length == 1 || tilesWith(ball, orangeWallBot).length == 1) {
      canRun = false;
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
................
................
................
................
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
  ................
  ................
  ................
  ................
  ................
  ................
  ................
  .....LLL........
  ....L111L.......
  ...L11L11L......
  ...L1L5L1L......
  ...L11L11L......
  ...L11111L......
  ....L111L.......
  .....LLL........
  ................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
  ................
  ................
  ................
  ................
  ...LLL..........
  ..L111L.........
  .L11L11L........
  .L1L5L1L........
  .L11L11L........
  .L11111L........
  ..L111L.........
  ...LLL..........
  ................
  ................
  ................
  ................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
  ................
  ................
  ....LLL.........
  ...L111L........
  ..L11L11L.......
  ..L1L5L1L.......
  ..L11L11L.......
  ..L11111L.......
  ...L111L........
  ....LLL.........
  ................
  ................
  ................
  ................
  ................
  ................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
  .......LLL......
  ......L111L.....
  .....L11L11L....
  .....L1L5L1L....
  .....L11L11L....
  .....L11111L....
  ......L111L.....
  .......LLL......
  ................
  ................
  ................
  ................
  ................
  ................
  ................
  ................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x += 0;
      setTimeout(() => {
        getFirst(ball).y -= 1;
        setLegend([ball, bitmap`
      ....LLLLLLLL....
      ...L111L1111L...
      ..L1111L1111LL..
      .L1L11LLLL1L11L.
      L111LLLLLLL1111L
      L111LL1111LL111L
      L11LL111111LL11L
      L11LL115511LLLLL
      L11LL115511LL11L
      LLLLL111111LL11L
      L111LL1111LL111L
      L1111LLLLLL1L11L
      .L11L1LLLL111LL.
      ..LL1111L1111L..
      ...L1111L111L...
      ....LLLLLLLL....`], );
        ballStatus = "down";
        canRun = true;
      }, 1000);
    } //end both if's

    if (tilesWith(ball, blueWall).length == 1) {
      canRun = false;
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
....LLL.........
...L111L........
..L11L11L.......
..L1L5L1L.......
..L11L11L.......
..L11111L.......
...L111L........
....LLL.........
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
.......LLL......
......L111L.....
.....L11L11L....
.....L1L5L1L....
.....L11L11L....
.....L11111L....
......L111L.....
.......LLL......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
..........LLL...
.........L111L..
........L11L11L.
........L1L5L1L.
........L11L11L.
........L11111L.
.........L111L..
..........LLL...
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //

      ballStatus = "up";
      getFirst(ball).x += 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x += 1;
        setLegend([ball, bitmap`
  ....LLLLLLLL....
  ...L111L1111L...
  ..L1111L1111LL..
  .L1L11LLLL1L11L.
  L111LLLLLLL1111L
  L111LL1111LL111L
  L11LL111111LL11L
  L11LL115511LLLLL
  L11LL115511LL11L
  LLLLL111111LL11L
  L111LL1111LL111L
  L1111LLLLLL1L11L
  .L11L1LLLL111LL.
  ..LL1111L1111L..
  ...L1111L111L...
  ....LLLLLLLL....`], );
        ballStatus = "down";
        canRun = true;
      }, 1000);
    } //end both if's
    if (tilesWith(ball, orangeWall).length == 1) {
      canRun = false;
      //animate ball
      setLegend([ball, bitmap`
................
................
................
................
...........LLL..
..........L111L.
.........L11L11L
.........L1L5L1L
.........L11L11L
.........L11111L
..........L111L.
...........LLL..
................
................
................
................`], );
      setTimeout(() => {
        setLegend([ball, bitmap`
................
.........LLL....
........L111L...
.......L11L11L..
.......L1L5L1L..
.......L11L11L..
.......L11111L..
........L111L...
.........LLL....
................
................
................
................
................
................
................`], );
        setTimeout(() => {
          setLegend([ball, bitmap`
......LLL.......
.....L111L......
....L11L11L.....
....L1L5L1L.....
....L11L11L.....
....L11111L.....
.....L111L......
......LLL.......
................
................
................
................
................
................
................
................`], );
          setTimeout(() => {
            setLegend([ball, bitmap`
................
...LLL..........
..L111L.........
.L11L11L........
.L1L5L1L........
.L11L11L........
.L11111L........
..L111L.........
...LLL..........
................
................
................
................
................
................
................`], );
            setTimeout(() => {
              setLegend([ball, bitmap`
................
................
................
................
..LLL...........
.L111L..........
L11L11L.........
L1L5L1L.........
L11L11L.........
L11111L.........
.L111L..........
..LLL...........
................
................
................
................`], );
            }, (1000 / 5));
          }, (1000 / 5));
        }, (1000 / 5));
      }, (1000 / 5));
      //
      ballStatus = "up";
      getFirst(ball).x -= 1;
      getFirst(ball).y -= 0;
      setTimeout(() => {
        getFirst(ball).x -= 1;
        setLegend([ball, bitmap`
    ....LLLLLLLL....
    ...L111L1111L...
    ..L1111L1111LL..
    .L1L11LLLL1L11L.
    L111LLLLLLL1111L
    L111LL1111LL111L
    L11LL111111LL11L
    L11LL115511LLLLL
    L11LL115511LL11L
    LLLLL111111LL11L
    L111LL1111LL111L
    L1111LLLLLL1L11L
    .L11L1LLLL111LL.
    ..LL1111L1111L..
    ...L1111L111L...
    ....LLLLLLLL....`], );
        ballStatus = "down";
        canRun = true;

      }, 1000);
    } //end both if's

    if (tilesWith(player, blueWall).length == 1) {
      currStatus = "blueWall";
      setSolids([orangeWall, blueWall]);
      setCarAnimation();
      setLegend([blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`], );
    }

  } // end canrun
} // end ballWallCollisions

function setCarAnimation() {
  //animations if list
  if (currStatus === "air" && currDirection === "right") {
    setLegend([player, bitmap`
..5555....55....
...CLL5550556...
...511555055L...
...CLL5550556...
..5555...L55....
....LL...LL.....
................
................
................
................
................
................
................
................
................
................`], );
  } else if (currStatus === "air" && currDirection === "left") {
    setLegend([player, bitmap`
....55....5555..
...6550555LLC...
...L550555115...
...6550555LLC...
....55L...5555..
.....LL...LL....
................
................
................
................
................
................
................
................
................
................`], );
  } else if (currStatus === "air" && currDirection === "up") {
    setLegend([player, bitmap`
......6L6.......
.....55555......
.....55555L.....
......000LL.....
......555.......
......555.......
......555.......
.....5L1L5L.....
.....5L1L5L.....
.....5C5C5......
.....5...5......
................
................
................
................
................`], );
  } else if (currStatus === "air" && currDirection === "down") {
    setLegend([player, bitmap`
.....5...5......
.....5C5C5......
.....5L1L5L.....
.....5L1L5L.....
......555.......
......555.......
......555.......
......000LL.....
.....55555L.....
.....55555......
......6L6.......
................
................
................
................
................`], );
  } else if (currStatus === "ground" && currDirection === "right") {
    setLegend([player, bitmap`
................
................
................
55555L..........
.77735....555L..
.5553555..555L..
.51133C55505556.
.5LL11L55005551.
.5LL11L55005551.
.51133C55505556.
.5553555..555L..
.77735....555L..
55555L..........
................
................
................`], );
  } else if (currStatus === "ground" && currDirection === "left") {
    setLegend([player, bitmap`
    ................
    ................
    ................
    ..........L55555
    ..L555....53777.
    ..L555..5553555.
    .65550555C33115.
    .15550055L11LL5.
    .15550055L11LL5.
    .65550555C33115.
    ..L555..5553555.
    ..L555....53777.
    ..........L55555
    ................
    ................
    ................`], );
  } else if (currStatus === "ground" && currDirection === "up") {
    setLegend([player, bitmap`
    ................
    ......6116......
    ....LL5555LL....
    ....55555555....
    ....55555555....
    ....55000055....
    ......5005......
    ......5555......
    .....555555.....
    .....5CLLC5.....
    ...L55311355L...
    ...5333113335...
    ...5751LL1575...
    ...5751LL1575...
    ...5755555575...
    ...5........5...`], );
  } else if (currStatus === "ground" && currDirection === "down") {
    setLegend([player, bitmap`
    ...5........5...
    ...5755555575...
    ...5751LL1575...
    ...5751LL1575...
    ...5333113335...
    ...L55311355L...
    .....5CLLC5.....
    .....555555.....
    ......5555......
    ......5005......
    ....55000055....
    ....55555555....
    ....55555555....
    ....LL5555LL....
    ......6116......
    ................`], );
  } else if (currDirection === "left" && currStatus == "blueWall") {
    setLegend([player, bitmap`
................
................
................
................
................
...LL...........
...165.5........
...5150.........
...5150.........
...165.5........
...LL...........
................
................
................
................
................`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  } else if (currDirection === "down" && currStatus == "blueWall") {
    setLegend([player, bitmap`
................
................
.......5........
.......5........
....5555........
...LL5C.........
...LL51.........
....555.........
....505.........
....505.........
....505.........
...L55..........
...L55..........
...555..........
...55...........
...16...........`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  } else if (currDirection === "up" && currStatus == "blueWall") {
    setLegend([player, bitmap`
...16...........
...55...........
...555..........
...L55..........
...L55..........
....505.........
....505.........
....505.........
....555.........
...LL51.........
...LL5C.........
....5555........
.......5........
.......5........
................
................`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  } else if (currDirection === "right" && currStatus == "orangeWall") {
    setLegend([player, bitmap`
................
................
................
................
................
...........LL...
........5.561...
.........0515...
.........0515...
........5.561...
...........LL...
................
................
................
................
................`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  } else if (currDirection === "down" && currStatus == "orangeWall") {
    setLegend([player, bitmap`
................
................
........5.......
........5.......
........5555....
.........C5LL...
.........15LL...
.........555....
.........505....
.........505....
.........505....
..........55L...
..........55L...
..........555...
...........55...
...........61...`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  } else if (currDirection === "up" && currStatus == "orangeWall") {
    setLegend([player, bitmap`
...........61...
...........55...
..........555...
..........55L...
..........55L...
.........505....
.........505....
.........505....
.........555....
.........15LL...
.........C5LL...
........5555....
........5.......
........5.......
................
................`], );
    setLegend([orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
      [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
      [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
      [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
      [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`], );
  }
  //end if list
} // end setCarAnimation function

function textDrawer() {
  if (currLevel == 0) {
    if (selectedText === 0) {
      clearText();
      addText("Training", { x: 12, y: 5, color: color`2` });
      addText("FreePlay", { x: 12, y: 7, color: color`7` });
    } else if (selectedText === 1) {
      clearText();
      addText("Training", { x: 12, y: 5, color: color`7` });
      addText("FreePlay", { x: 12, y: 7, color: color`2` });
    }


  } else if (currLevel === 1) {
    clearText();
    addText(orangeScore.toString(), { x: 8, y: 3, color: color`9` });
    addText(blueScore.toString(), { x: 10, y: 3, color: color`5` });
  } else if (currLevel === 2) {
    clearText();
    addText("hint: jump with k", { x: 0, y: 3, color: color`2` });
    setTimeout(() => {
      clearText();
    }, 1000);
  } else if (currLevel === 5) {
    clearText();
    addText("training complete ", { x: 0, y: 3, color: color`2` });
    addText("i - return to menu ", { x: 0, y: 5, color: color`C` });
    setTimeout(() => {
      clearText();
    }, 1000);
  }
} //end textDrawer function

function setSprites() {
  const player = "a";
  const player0 = "b";


  const goalExpOrange = "c";
  const goalExpBlue = "d";
  const orangeWall = "e";
  const blueWall = "f";
  const orangeWallTop = "w";
  const blueWallTop = "x";
  const orangeWallBot = "z";
  const blueWallBot = "y";
  const wall = "o";

  const ball = "g";
  const orangeGoalTop = "h";
  const orangeGoalMid = "i";
  const orangeGoalBot = "j";
  const blueGoalTop = "k";
  const blueGoalMid = "l";
  const blueGoalBot = "m";
  const grass = "n";



  setLegend(
    [orangeWall, bitmap`
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL
..19LLLLLLLLLLLL`],
    [blueWall, bitmap`
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..
LLLLLLLLLLLL51..`],
    [orangeWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
9999999999999999
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
    [blueWallTop, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
5555555555555555
1111111111111111
1111111111111111
................
................
................
................
................
................
................
................
................
................`],
    [orangeWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
9999999999999999
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],
    [blueWallBot, bitmap`
................
................
................
................
................
................
................
................
................
................
1111111111111111
1111111111111111
5555555555555555
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],

    [player, bitmap`
................
................
................
55555L..........
.77735....555L..
.5553555..555L..
.511CCC55505556.
.5LL11L55005551.
.5LL11L55005551.
.511CCC55505556.
.5553555..555L..
.77735....555L..
55555L..........
................
................
................`],
    [player0, bitmap`
................
................
................
..........L99999
..L999....9C333.
..L999..999C999.
.69990999CCC119.
.19990099L11LL9.
.19990099L11LL9.
.69990999CCC119.
..L999..999C999.
..L999....9C333.
..........L99999
................
................
................`],
    [wall, bitmap`
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL
LLLLLLLLLLLLLLLL`],

    [ball, bitmap`
....LLLLLLLL....
...L111L1111L...
..L1111L1111LL..
.L1L11LLLL1L11L.
L111LLLLLLL1111L
L111LL1111LL111L
L11LL111111LL11L
L11LL115511LLLLL
L11LL115511LL11L
LLLLL111111LL11L
L111LL1111LL111L
L1111LLLLLL1L11L
.L11L1LLLL111LL.
..LL1111L1111L..
...L1111L111L...
....LLLLLLLL....`],
    [orangeGoalTop, bitmap`
..19LLLLLLLLLLLL
..19999999999LLL
............99LL
.............9LL
.............9LL
.............99L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L`],
    [orangeGoalMid, bitmap`
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L`],
    [orangeGoalBot, bitmap`
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
..............9L
.............99L
.............9LL
.............9LL
............99LL
..19999999999LLL
..19LLLLLLLLLLLL`],
    [blueGoalTop, bitmap`
LLLLLLLLLLLL51..
LLL55555555551..
LL55............
LL5.............
LL5.............
L55.............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............`],
    [blueGoalMid, bitmap`
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............`],
    [blueGoalBot, bitmap`
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L5..............
L55.............
LL5.............
LL5.............
LL55............
LLL55555555551..
LLLLLLLLLLLL51..`],
    [grass, bitmap`
44444444444444DD
4444D24444444DD4
44444D44DD424444
4DD444D4D44DD444
44D444DDD444D444
4444444444444444
444444444444DDD4
444444444444D444
44244D4444444444
44D4DD4444DD4444
44D4D4442D4DD4D4
44DDD444D4444D44
DD44444DD444DD44
4DD4444D44444444
44D4444444444444
4444444444444444`],
    [goalExpBlue, bitmap`
..7.L777LLLL7777
7777771771777557
.777111L77755257
.55571LLL7522777
752257777552777L
L75225575557711L
L117552255777777
L1177752557LLLL7
L17557722255L11L
222257775225711L
755777117555571L
5777777L7755557L
77777777LL752277
77LL1177L1155257
77.L1177L1175555
.7..LLL77LLL7757`],
    [goalExpOrange, bitmap`
999999LLLLLL.99.
.999999L111199..
..99CC991119999.
.L122CC99L199C99
L11129CC9999CC1L
L111LLC2299CC11L
L11LL11CC2CCL11L
L11LL11CC22CLLLL
L11LL99CCCCC911L
LLLLCCCCC922991L
L9CCC22CCCC22C1L
99999CL9999CC22L
99999999LL999CCC
.9999991L1999999
.9999111L119999.
99..LLLLLLLL..99`],
  );
} // end setSprites